test: add separate snapshot update command and rely on object comparison rather than strings - #1007
Merged
Merged
Conversation
…son rather than strings In the previous commit I tried to stabilise the produced snapshots so that they match the output from the discogs function, however it lead to some hidden problems. The only reason I tried to do it is to keep the `pnpm test:discogs -u` command so that vitest handles snapshot files, however fixing the hidden issue mentioned above together with already a complicated setup I think we shouldn't rely on snapshot comparison as strings at all. It's much easier to compare them as objects and just create a separate command to regenerate snapshots, and this is what the current PR is doing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the previous commit I tried to stabilise the produced snapshots so that they match the output from the discogs function, however it led to some hidden problems with oxfmt. The only reason I tried to do it is to keep the
pnpm test:discogs -ucommand so that vitest handles snapshot files, however fixing the hidden issue mentioned above together with already a complicated setup I think we shouldn't rely on snapshot comparison as strings at all. It's much easier to compare them as objects and just create a separate command to regenerate snapshots, and this is what the current PR is doing.